 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
  package com.viettel.core.enumtype;
  import java.util.HashMap;
  import java.util.Map;
  /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 11:34:02
   */
  public enum QuestionsStatus {
      
  	  DELETED(-1), 	//xoa
      HIDE (0), 	//an
      NOT_ANSWER (1),//Chua tra loi
      CONSIGN(2),	// giao cho chuyen gia
      ANSWER(3),	// da tra loi
      COMPLETE(4), 	//hoan tat
  	  CANCEL(5);	//huy
      
      /** The value. */
      private Integer value;
      
      /** The values. */
      private static Map<Integer, QuestionsStatus> values = null;
      
      /**
       * Gets the value.
       * 
       * @return the value
       */
      public Integer getValue() {
          return value;
      }
      
      /**
       * Instantiates a new gender type.
       * 
       * @param value
       *            the value
       */
      QuestionsStatus(Integer value) {
          this.value = value;
      }
      
      /**
       * Parses the value.
       * 
       * @param value
       *            the value
       * @return the gender type
       */
      public static QuestionsStatus parseValue(Integer value) {
      	if (value != null && value == -1){
      		value = -1;
      	}    		
          if (values == null) {
              values = new HashMap<Integer, QuestionsStatus>(
                      QuestionsStatus.values().length);
              for (QuestionsStatus e : QuestionsStatus.values())
                  values.put(e.getValue(), e);
          }
          return values.get(value);
      }
      
      public static String getName(Integer value) {
    	  String name="";
    	  switch (value) {
    	  case 0:
    		  name = "Ẩn";
    		  break;
    	  case 1:
    		  name = "Chưa trả lời";
    		  break;
    	  case 2:
    		  name = "Giao cho chuyên gia";
    		  break;
    	  case 3:
    		  name = "Đã trả lời";
    		  break;
    	  case 4:
    		  name = "Hoàn tất";
    		  break;
    	  case 5:
    		  name = "Hủy";
    		  break;
    	  }
    	  return name;
      }
  }
 
